import request from '@/utils/request'

export default {

       //============================章节api===============================================
    /***
     *  根据 课程 id 查询相关联的 章节、小结信息
     * 
     */
    getChapterVideoByCourseId(courseId){

        return request({
            url:'/eduservice/chapter/get/chapter/video/'+courseId,
            method:'get'
        });
    },

    /**
     *  添加章节信息
     * @param {*} chapter  章节信息
     */
    addChapter(chapter){
        return request({
            url:'/eduservice/chapter/add/chapter',
            method:'post',
            data:chapter
        });
    },

    /**
     *  根据id获取 章节信息
     * @param {*} id  
     */
    getChapterById(id){
        return request({
            url:'/eduservice/chapter/find/chapter/by/'+id,
            method:'get'
        });
    },

    /**
     *  修改章节信息
     * @param {*} chapter  
     */
    editChapter(chapter){
        return request({
            url:'/eduservice/chapter/edit/chapter',
            method:'post',
            data:chapter
        });
    },
    /**
     *   删除章节信息
     * @param {*} id 
     */
    removeChapterById(id){
        return request({
            url:'/eduservice/chapter/remove/chapter/'+id,
            method:'delete'
        });
    }
}